namespace Ds.DataBase.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class 工作计划和模板继承 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.JiXiaoSons", "JiXiao_mbid", "dbo.MoBans");
            DropIndex("dbo.JiXiaoSons", new[] { "JiXiao_mbid" });
            DropColumn("dbo.MoBans", "jhsx");
            DropColumn("dbo.MoBans", "gzjhnr");
            DropColumn("dbo.MoBans", "gzjhfz");
            DropColumn("dbo.MoBans", "gzjhhtml");
            DropColumn("dbo.MoBans", "cjrid");
            DropColumn("dbo.MoBans", "jxsx");
            DropColumn("dbo.MoBans", "jxnr");
            DropColumn("dbo.MoBans", "jxfz");
            DropColumn("dbo.MoBans", "jxhtml");
            DropColumn("dbo.MoBans", "jxtype");
            DropColumn("dbo.MoBans", "cjrid1");
            DropColumn("dbo.MoBans", "Discriminator");
            DropTable("dbo.JiXiaoSons");
        }
        
        public override void Down()
        {
            CreateTable(
                "dbo.JiXiaoSons",
                c => new
                    {
                        jxsid = c.Int(nullable: false, identity: true),
                        jxssx = c.Int(nullable: false),
                        jxsnr = c.String(),
                        jxfz = c.Decimal(nullable: false, precision: 18, scale: 2),
                        jxshtml = c.String(),
                        JiXiao_mbid = c.Int(),
                    })
                .PrimaryKey(t => t.jxsid);
            
            AddColumn("dbo.MoBans", "Discriminator", c => c.String(nullable: false, maxLength: 128));
            AddColumn("dbo.MoBans", "cjrid1", c => c.Int());
            AddColumn("dbo.MoBans", "jxtype", c => c.Int());
            AddColumn("dbo.MoBans", "jxhtml", c => c.String());
            AddColumn("dbo.MoBans", "jxfz", c => c.Decimal(precision: 18, scale: 2));
            AddColumn("dbo.MoBans", "jxnr", c => c.String());
            AddColumn("dbo.MoBans", "jxsx", c => c.Int());
            AddColumn("dbo.MoBans", "cjrid", c => c.Int());
            AddColumn("dbo.MoBans", "gzjhhtml", c => c.String());
            AddColumn("dbo.MoBans", "gzjhfz", c => c.Decimal(precision: 18, scale: 2));
            AddColumn("dbo.MoBans", "gzjhnr", c => c.String());
            AddColumn("dbo.MoBans", "jhsx", c => c.Int());
            CreateIndex("dbo.JiXiaoSons", "JiXiao_mbid");
            AddForeignKey("dbo.JiXiaoSons", "JiXiao_mbid", "dbo.MoBans", "mbid");
        }
    }
}
